<?php
/**
* エラーチェッククラス
**/
require_once( '../system/Class_M_DAO.php' );
class t_m_mail extends Class_M_DAO {
	//protected properties begin
	/**
	 *
	 * テーブル名
	 *
	 * @access    protected
	 * @var       string
	 *
	 */
	protected $_table = "EMAIL";
	
	/**
	 *
	 * 主キー名
	 *
	 * @access    protected
	 * @var       string
	 *
	 */
	protected $_pkey = "id";
	
	/**
	 *
	 * ソート順
	 *
	 * @access    protected
	 * @var       string
	 *
	 */
	 protected $_order = "id";
	 
	  protected $_cols  = array(
	 	"id"           => array(ECJP_VARTYPE_STR),
		"type"              => array(ECJP_VARTYPE_STR),
		"date"      => array(ECJP_VARTYPE_STR),
	    "name"      => array(ECJP_VARTYPE_STR),
		"address"   => array(ECJP_VARTYPE_STR),
	    "ereturn"        => array(ECJP_VARTYPE_STR)
	 );
	 
	  //
	public  function savemail($mailer, $toname, $tomail, $sentok){	
		$v_mail["type"] = $mailer["letter_title"];
		$v_mail["date"] = date('Y-m-d H:i:s');
		$v_mail["name"] = $toname;
		$v_mail["address"] = $tomail;
		if ( $sentok ) {
			$v_mail["ereturn"] = "送信OK";
		}else {
			$v_mail["ereturn"] = "送信失敗";
		}
		
		$this->add($v_mail);
	}
	
}
?>